home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
dev
/
cross
/
fast05.lha
/
Docs
/
covert.doc
< prev
next >
Wrap
Text File
|
1997-05-23
|
3KB
|
92 lines
COVERTING Asm05 SOURCE CODE TO MOTOROLA FORMAT
The Asm05 assembler is not compatable with standard 68HC05 assemblers. It
borrows syntax from Intel & 6502 assemblers. Listed here are the
differences.
1) Motorola 4 char & 5 char codes have been converted to 3 character
format
Motorola FAST6805 Description
BHCC BFC Branch if half carry Flag Clear
BHCS BFS Branch if half carry Flag Set
BRSET BBS Branch if Bit Set
BRCLR BBC Branch if Bit Clear
BSET SMB Set Memory Bit
BCLR CMB Clear Memory Bit
STOP STP stop
WAIT WAI wait
2) When refering to registers the Fast assemblers expect the register
name in the address field not the opcode.
Motorola FAST6805
INCX INC X
DECX DEC X
RORX ROR X
ASLX ASL X
CLRX CLR X
COMX COM X
LSLX LSL X
LSRX LSR X
NEGX NEG X
TSTX TST X
INCA INC A
DECA DEC A
RORA ROR A
ASLA ASL A
CLRA CLR A
COMA COM A
LSLA LSL A
LSRA LSR A
NEGA NEG A
TSTA TST A
3) The bit field instructions take a different format
Motorola Asm05
BSET 1,$50 SMB $50.1
BCLR 1,$50 CMB $50.1
BRCLR 1,$50,label BBC $50.1 label
BRSET 1,$50,label BBS $50.1 label
4) In standard assemblers data tables uses db in front of each line
of the table.
Motorola Asm05
db $FF,$77,$33,$EE $FF,$77,$33,$EE ; data table
dw #label
5) In standard assemblers ROM vectors uses dw in front of each
vector to signify a word size.
Motorola Asm05
dw #label #label
To convert a file do the following
1) convert opcodes - replace "BBS" with "BSET"
2) convert registers - replace " X" with "X"
3) convert bit fields - replace " $**.*" with " *,$**"
4) convert tables _ replace "<tab>$" with "<tab>db $"
To Convert variable declarations
1) - replace "<Name>" with "<Name> EQU"
To Convert files containing named bits
1) replace "<bitname>" with "#,<bytename>"
Do It The Easy Way
When converting files if all the bit fields are named then a simple
search & replace file is all that is required. The utility "TxtRep"
takes a replace file (a list of search & replaces) and a source file
and produces a new source file compatable with Motorola syntax. Just
make up a ".rep" file listing all the named bit fields & their Motorola
replacements (ie NameBIT|#,Name). Use the file "ISet.rep" to convert the
instruction set. Duplicate your header file with the bit fields missing
and EQU added to variable declarations. Use the alternate header when
assemblig via motorola.
I usually make up a batch file which
1) makes a new copy of my Asm05 source (or sources)
2) uses TxtRep with ISet.rep to fix instruction set
3) uses TxtRep with a rep file to fix any bit fields
4) uses TxtRep with a rep file to add EQU to my variable declaration
files